def calculate_average_of_moving_averages(symbol, ma_period=30, count=30):
    """
    计算指定数量移动平均线的平均值
    """
    # 获取足够数据
    rates = mt5.copy_rates_from_pos(symbol, mt5.TIMEFRAME_M1, 0, ma_period + count)
    
    if rates is None or len(rates) < ma_period:
        print(f"{symbol} 数据不足")
        return None
    
    # 提取收盘价
    close_prices = np.array([rate['close'] for rate in rates])
    
    # 计算移动平均线
    weights = np.ones(ma_period) / ma_period
    moving_averages = np.convolve(close_prices, weights, mode='valid')
    
    # 取指定数量的移动平均值并计算平均值
    selected_mas = moving_averages[:count]  # 取前count个
    avg_of_mas = np.mean(selected_mas)
    
    return avg_of_mas